
local mt = ac.skill['八方镇守']
mt.distance = 2000
mt.missile_art = [[e3c096f02dd0302a23a758afbaf70a09.mdl]]
mt.missile_speed = 900
mt.missile_height = 90
mt.targettype = '点'
mt.range = 1800

function mt:on_cast_shot()
    local hero = self.owner
    local target = self.target
    local point1 = hero:get_point()
    local point2 = target:get_point()
    local angle = point1/point2 + 60
    local damage = hero:get('攻击') * self.data1/100
    local time = 1
    hero:add_effect([[9753276ca38a709ee315c35f23214d61.mdl]],'chest',1)
    for a=1,8 do
        local r = angle + a*45
        point1:effect{
            model = [[fdcd174428a0c65293cd271ce959629e.mdx]],
            angle = r,
            time = time + 1,
            height = 90,
        }
        hero:add_restriction '硬直'

        ac.wait(time*1000,function()
            hero:remove_restriction '硬直'
            if hero:is_alive() then
                local mover = hero:launch_wave(self.missile_art,r,900,1200)
                local track = hero:track_select(mover,150,mover.distance/mover.speed,function(u)
                    hero:create_damage(u,damage,self)
                end)
            end
        end)
    end
    ac.wait(time*1000+100,function()
        hero:issue_order('attack',ac.enemy.base)
    end)
    
end
